package com.yunduansing.demo.service;

import com.yunduansing.demo.exception.MyException;
import com.yunduansing.demo.model.account.LoginUserModel;
import com.yunduansing.demo.model.common.PassportModel;

public interface JwtService {
    /**
     * 验证token
     * @param username
     * @param isRefresh
     * @return
     */
    boolean validateToken(String username,String token,boolean isRefresh);
    /**
     * 获取token
     * @return
     */
    String getToken(String username);
    /**
     * 获取refresh token
     * @return
     */
    String getRereshToken(String username);
    /**
     * 获取当前登录用户
     * @return
     */
    PassportModel getLoginUser();
    /**
     * 根据jwt token获取用户
     * @throws MyException
     */
    LoginUserModel getLoginUserBytoken(String token) throws MyException;
}
